package com.base.service.impl;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.base.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import com.base.mapper.voipmapper.PayinfoesMapper;
import com.base.po.sqlparam.PayinfoesExamplePage;
import com.base.po.voip.Payinfoes;
import com.base.po.voip.PayinfoesExample;
import com.base.service.PayinfoesService;
import com.base.utils.Produce;
import org.springframework.stereotype.Service;

@Service("payinfoesService")
public class PayinfoesServiceImpl implements PayinfoesService {
	@Autowired
	private PayinfoesMapper payinfoesMapper;

	@Override
	public int countByExample(PayinfoesExample example) {
		return payinfoesMapper.countByExample(example);
	}

	@Override
	public int deleteByExample(PayinfoesExample example) {
		return payinfoesMapper.deleteByExample(example);
	}

	@Override
	public int deleteByPrimaryKey(String id) {
		if (id == null) {
			return 0;
		}
		return payinfoesMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(String mobile, String cardno, String pwd, String parentid, Boolean status, Integer money,
			Boolean datastatus, Integer type, String alistatus, String ordernum, String alimoney, Integer cardtype) {
		Payinfoes record = new Payinfoes(Produce.getUUID(), mobile, cardno, pwd, parentid, status, money, datastatus,
				Produce.getNowDate(), type, alistatus, ordernum, alimoney, cardtype);
		return payinfoesMapper.insert(record);
	}

	@Override
	public int insertSelective(Payinfoes record) {
		return payinfoesMapper.insertSelective(record);
	}

	@Override
	public List<Payinfoes> selectByExample(PayinfoesExample example) {
		return payinfoesMapper.selectByExample(example);
	}

	@Override
	public List<Payinfoes> selectByExamplePage(PayinfoesExamplePage example) {
		return payinfoesMapper.selectByExamplePage(example);
	}

	@Override
	public List<Payinfoes> selectByUser(String parentid, String mobile) {
		return payinfoesMapper.selectByUser(parentid, mobile);
	}

	@Override
	public List<Payinfoes> selectByPerformance(Page page, String userid, Date priopentime1, Date priopentime2) {
		return payinfoesMapper.selectByPerformance(page, userid, priopentime1, priopentime2);
	}

	@Override
	public List<Payinfoes> selectByMuskUserId(String parentid) {
		return payinfoesMapper.selectByMuskUserId(parentid);
	}

	@Override
	public List<Payinfoes> selectByUserId(String userid) {
		return payinfoesMapper.selectByUserId(userid);
	}

	@Override
	public Payinfoes selectByPrimaryKey(String id) {
		if (id == null) {
			return null;
		}
		return payinfoesMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByExampleSelective(Payinfoes record, PayinfoesExample example) {
		return payinfoesMapper.updateByExampleSelective(record, example);
	}

	@Override
	public int updateByExample(Payinfoes record, PayinfoesExample example) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return payinfoesMapper.updateByExample(record, example);
	}

	@Override
	public int updateByPrimaryKeySelective(Payinfoes record) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return payinfoesMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(Payinfoes record) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return payinfoesMapper.updateByPrimaryKey(record);
	}

	@Override
	public Payinfoes selectByOrderNum(String ordernum) {
		return payinfoesMapper.selectByOrderNum(ordernum);
	}

	@Override
	public Payinfoes selectByShopCountMoney(String shopId) {
		return payinfoesMapper.selectByShopCountMoney(shopId);
	}

	@Override
	public int payinfoesByCount(Payinfoes record) {
		return payinfoesMapper.payinfoesByCount(record);
	}

	@Override
	public int countByPerformance(String userid, Date priopentime1, Date priopentime2) {
		return payinfoesMapper.countByPerformance(userid, priopentime1, priopentime2);
	}

	@Override
	public BigDecimal selectAllMoney(String parentid, Date begin, Date end) {
		return payinfoesMapper.selectAllMoney(parentid, begin, end);
	}

	@Override
	public Payinfoes sumByMobile(String mobile) {
		return payinfoesMapper.sumByMobile(mobile);
	}

	@Override
	public Payinfoes sumByMobileAndParentid(String mobile, String parentid) {
		return payinfoesMapper.sumByMobileAndParentid(mobile, parentid);
	}

	@Override
	public Payinfoes sumByMobileAndShopid(String mobile, String parentid) {
		return payinfoesMapper.sumByMobileAndShopid(mobile, parentid);
	}

	@Override
	public BigDecimal selectByMoney(String parentid, String mobile) {
		return payinfoesMapper.selectByMoney(parentid, mobile);
	}

	@Override
	public BigDecimal selectAllPerformance(String userid, Integer level) {
		return payinfoesMapper.selectAllPerformance(userid, level);
	}

	@Override
	public BigDecimal selectPerformance(String userid, Date priopentime1, Date priopentime2) {
		return payinfoesMapper.selectPerformance(userid, priopentime1, priopentime2);
	}

	@Override
	public BigDecimal selectLv1Performance(String userid, Date priopentime1, Date priopentime2) {
		return payinfoesMapper.selectLv1Performance(userid, priopentime1, priopentime2);
	}

	@Override
	public BigDecimal selectLv1And2Performance(String userid, Date priopentime1, Date priopentime2) {
		return payinfoesMapper.selectLv1And2Performance(userid, priopentime1, priopentime2);
	}

	@Override
	public BigDecimal selectPerformanceTabId(String tabid, Date priopentime1, Date priopentime2) {
		return payinfoesMapper.selectPerformanceTabId(tabid, priopentime1, priopentime2);
	}


	@Override
	public int countDay(String parentid, Date begin, Date end) {
		return payinfoesMapper.countDay(parentid, begin, end);
	}

	@Override
	public Integer countAllBytype(String parentId, String time1, String time2, int type, Page page,String mobile) {
		return payinfoesMapper.countAllBytype( parentId,  time1,  time2,  type,  page, mobile);
	}

	@Override
	public List<Payinfoes> selectAllBytype(String parentId, String time1, String time2, int type, Page page,String mobile) {
		return payinfoesMapper.selectAllBytype( parentId,time1,  time2,  type,  page, mobile);
	}

}
